<?php

namespace app\admin\validate\menu;

use think\Validate;

class Menu extends Validate
{
    protected $rule = [
        'menu_name' => 'require|max:20|token',
        'menu_page_url' => 'require|max:50',
        'menu_sort' => 'number|between:0,9999',
        'menu_icon' => 'max:20'
    ];

    protected $message = [
        'menu_name.require' => '菜单名称不能为空',
        'menu_name.max' => '菜单名称不能超过20个字符',
        'menu_sort.number' => '排序必须为数字',
        'menu_sort.between' => '排序范围在0到9999之间',
        'menu_page_url.require' => '跳转链接不能为空',
        'menu_page_url.max' => '跳转链接不能超过50个字符',
        'menu_icon.max' => '菜单图标不能超过20个字符'
    ];
}